Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return 415 rather than 400 on Urlencoded Content-Type mismatch #3334

Merged
merged 2 commits into from
Jun 10, 2024

Conversation

mpalmer
Copy link
Contributor

@mpalmer mpalmer commented Apr 15, 2024

PR Type

Bug Fix

PR Checklist

  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • A changelog entry has been made for the appropriate packages.
  • Format code with the latest stable rustfmt.
  • (Team) Label with affected crates and semver status.

Overview

When the Content-Type of a request that was parsed by UrlEncoded wasn't appropriate, a generic 400 response was returned. Given that there is a dedicated response code for this (415), I thought it better to return that instead, so now it does.

@robjtede robjtede enabled auto-merge June 10, 2024 01:07
@robjtede
Copy link
Member

robjtede commented Jun 10, 2024

LGTM. I think this is more correct so worth the potential issues in downstream tests.

@robjtede robjtede added this pull request to the merge queue Jun 10, 2024
Merged via the queue into actix:master with commit 59e42c1 Jun 10, 2024
13 checks passed
@mpalmer mpalmer deleted the unsupported-media-type branch June 10, 2024 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-web project: actix-web B-semver-patch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants